package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.OrderBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.CreateOderContract;
import com.seveneight.baijiesteward.ui.user.model.CreateOrderModel;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/28.
 */

public class CreateOrderPresenter implements CreateOderContract.CreateOderPresenter {

    CreateOderContract.CreateOderView createOderView;
    CreateOderContract.CreateOderModel createOderModel;
    public CreateOrderPresenter(CreateOderContract.CreateOderView createOderView){
        this.createOderView=createOderView;
        createOderModel=new CreateOrderModel();

    }

    @Override
    public void createOrder(Context context, RequestBody body) {
        createOderModel.createOrder(context,body, new MyCallBack<OrderBean>() {
            @Override
            public void onSuccess(OrderBean orderBean) {
                createOderView.reBackOrderInfo(orderBean);
            }

            @Override
            public void onFailed() {

            }
        });

    }
}
